package com.travel.controller.admin;

import com.travel.pojo.dto.UserDTO;
import com.travel.pojo.entity.AdminUser;
import com.travel.service.IAdminUserService;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController("adminLoginController")
@RequiredArgsConstructor
@RequestMapping("/admin")
@CrossOrigin
public class AdminLoginController {

    private final IAdminUserService adminUserService;

    @GetMapping("/login")
    public AdminUser login(UserDTO userDTO){
        return adminUserService.login(userDTO);
    }
}
